home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / x / volume6 / xpwdoc / part02 < prev    next >
Encoding:
Internet Message Format  |  1990-04-11  |  66.4 KB

  1. Path: uunet!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!ames!sun-barr!newstop!sun!NSFnet-Relay.AC.UK
  2. From: jonm%syma.sussex.ac.uk@NSFnet-Relay.AC.UK (Jonathan Meyer)
  3. Newsgroups: comp.sources.x
  4. Subject: v06i066: Xpw Documentation, Part02/02
  5. Message-ID: <134354@sun.Eng.Sun.COM>
  6. Date: 12 Apr 90 07:36:55 GMT
  7. Sender: news@sun.Eng.Sun.COM
  8. Lines: 1686
  9. Approved: argv@sun.com
  10.  
  11. Submitted-by: Jonathan Meyer <jonm%syma.sussex.ac.uk@NSFnet-Relay.AC.UK>
  12. Posting-number: Volume 6, Issue 66
  13. Archive-name: xpwdoc/part02
  14.  
  15.  
  16. #! /bin/sh
  17. # This is a shell archive.  Remove anything before this line, then unpack
  18. # it by saving it into a file and typing "sh file".  To overwrite existing
  19. # files, type "sh file -c".  You can also feed this as standard input via
  20. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  21. # will see the following message at the end:
  22. #        "End of archive 2 (of 2)."
  23. # Contents:  doc/ref/PopScrollText doc/ref/PopText
  24. #   doc/ref/XpwCallMethod doc/ref/XpwMethods doc/ref/XpwResources
  25. #   doc/man/poplog.man doc/sysdoc/PopWidgets.imp
  26. # Wrapped by jonm@csunb on Wed Apr  4 16:16:15 1990
  27. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  28. if test -f 'doc/ref/PopScrollText' -a "${1}" != "-c" ; then 
  29.   echo shar: Will not clobber existing file \"'doc/ref/PopScrollText'\"
  30. else
  31. echo shar: Extracting \"'doc/ref/PopScrollText'\" \(19823 characters\)
  32. sed "s/^X//" >'doc/ref/PopScrollText' <<'END_OF_FILE'
  33. XREF *PopScrollText                             Jonathan Meyer, Jan 1990
  34. X
  35. XPoplog Widget Set, revision 3.
  36. X
  37. XThis file describes the PopScrollText widget class, which is part of the
  38. XPoplog Widget Set. For details of other widgets in the Poplog Widget
  39. XSet, see HELP *PopWidgets. For information about the Pop-11 interface to
  40. Xthe PopScrollText widget, see HELP *PopScrollText.
  41. X
  42. X
  43. X         CONTENTS - (Use <ENTER> g to access required sections)
  44. X
  45. X -- PopScrollText Widget
  46. X -- PopScrollText Resources
  47. X -- Information about new resources
  48. X -- Handling Exposure Events
  49. X -- Actions
  50. X -- PopScrollText Translations
  51. X -- Methods
  52. X -- Scroll Operations
  53. X -- Clear Operations
  54. X -- Write Operations
  55. X -- Cursor and Misc Operations
  56. X
  57. X-- PopScrollText Widget -----------------------------------------------
  58. X
  59. XSuperclass: PopCore
  60. X
  61. XThe PopScrollText widget is a low level text widget. It provides the programmer
  62. Xwith the ability to write text on a window, and scroll it about. The widget also
  63. Xnotifies the application of exposure and input events, so that the program can
  64. Xredraw the text, process input etc. The PopScrollText widget maintains an
  65. XXtNexposedLines resource, which contains a list of lines that need redrawing
  66. Xafter an exposure event. It also converts mouse locations into text rows/
  67. Xcolumns, and allows applications to manipulate a text cursor.
  68. X
  69. XThe widget does not keep a copy of the text that is on the window, and so
  70. Xit cannot refresh itself. However, it is very helpful for editors (VED)
  71. Xthat already do the hard work of keeping a terminal updated, but don't
  72. Xwork with Xlib.
  73. X
  74. XThere are a variety of operations that can be performed on ScrollText
  75. Xwidgets. Most of the operations involve scrolling text, or writing text.
  76. X
  77. X
  78. X-- PopScrollText Resources --------------------------------------------
  79. X
  80. XPopScrollText inherits all of the resources of PopCore. The following
  81. Xresources are retrieved from the resource database or the argument list
  82. Xwhen PopScrollText widgets are created:
  83. X
  84. X
  85. X========================================================================
  86. XName             Class        RepType    Default*   Description
  87. X========================================================================
  88. XXtNwidth         Width        Dimension  0          Window width
  89. XXtNheight        Height       Dimension  0          Window height
  90. XXtNx             X            Position   0          X coordinate in pixels
  91. XXtNy             Y            Position   0          Y coordinate in pixels
  92. XXtNborderWidth   BorderWidth  Dimension  1          Border width in pixels
  93. XXtNborderPixmap  BorderPixmap Pixmap     None       Window border pixmap
  94. XXtNborderColor   BorderColor  Pixel      foreground Window border color
  95. XXtNbackground    Background   Pixel      XtDefault  Window background color
  96. XXtNforeground    Foreground   Pixel      XtDefault  Window foreground color
  97. XXtNfont          Font         FontStruct XtDefault  Font for text operations
  98. XXtNpointerShape  Cursor       Cursor     None       mouse cursor(cursorfont)
  99. XXtNtranslations  Translations String     see below  Event-to-action translations
  100. XXtNpopCallback   Callback     Pointer    NULL       Callbacks for expose events
  101. XXtNautoFlush     Boolean      Boolean    TRUE       XFlush after methods?
  102. XXtNusersGC       GC           Pointer    NULL       Graphics Context for ops
  103. XXtNmodifiers     Parameter    Int        None       event->state modifiers
  104. XXtNtopMargin     TopMargin    Dimension  0          Distance to start of text
  105. XXtNleftMargin    LeftMargin   Dimension  2          Distance to start of text
  106. XXtNfontWidth     Width        Dimension  None       Width of current font
  107. XXtNfontHeight    Height       Dimension  None       Height of current font
  108. XXtNcursorRow     Position     Position   0          Cursors Y location
  109. XXtNcursorColum   Position     Position   0          Cursors X location
  110. XXtNcursorStatus  CursorStatus Boolean    TRUE       Cursor on/off 
  111. XXtNmouseX        MouseLocation Int       None       Mouse column
  112. XXtNmouseY        MouseLocation Int       None       Mouse row    
  113. XXtNnumRows       Dimension    Dimension  24         Text columns
  114. XXtNnumColumns    Dimension    Dimension  80         Text rows 
  115. XXtNexposedLines  Parameter    (int *)    NULL       Lines that need redrawing
  116. XXtNkey           Key          String     NULL       Ascii string of KeyPress
  117. XXtNkeyboardEvent Callback     Callback   NULL       keyboard inputs callback
  118. XXtNbuttonEvent   Callback     Callback   NULL       Mouse buttonpress events
  119. XXtNmotionEvent   Callback     Callback   NULL       Mouse motion events
  120. XXtNdestroyCallback            Callback   NULL       XtDestroyWidget callback
  121. X
  122. X
  123. X-- Information about new resources -----------------------------------
  124. X
  125. XXtNfontWidth XtNfontHeight
  126. X    fontWidth and fontHeight are the dimensions of the current font in pixels.
  127. X    The font is expected to have a fixed width.
  128. X
  129. XXtNtopMargin XtNleftMargin
  130. X    distance from top and left of window where text starts.
  131. X
  132. XXtNnumRows, XtNnumColumns
  133. X    These are based upon the current font and window size. They are calculated
  134. X    from fontWidth and fontHeight, as well as the width and height of the
  135. X    window. They are the number of text rows and columns that can be fitted
  136. X    into the window. Row 0, Column 0 is the top left character of the window.
  137. X
  138. X    Changing the widgets font will cause fontWidth, fontHeight, numRows
  139. X    and numColumns to be recalculated. Resizing the widget will cause
  140. X    numRows and numColumns to be recalculated, and exposedLines to be
  141. X    recreated.
  142. X
  143. XXtNexposedLines
  144. X    The 'exposedLines' resource is an array of unsigned ints, with the number 
  145. X    of elements of the array kept the same as the number of rows of text in the
  146. X    widget. After an exposure event, this array is set as follows:
  147. X    For each line of text in the window that needs to be redrawn:
  148. X    the lower short of the array element for that line is set to
  149. X    the start column and the higher short is set to the end column of text 
  150. X    that needs to be redrawn.  See below for more information on exposed lines.
  151. X
  152. X
  153. XXtNcursorRow, XtNcursorColumn
  154. X    An inverse  rectangle is used to represent the cursor. Changing these 
  155. X    resources will cause the cursor to be unplotted and moved to the new
  156. X    location. Any of the methods that can be applied to the PopScrollText
  157. X    widget are aware of the cursor, and will replot it if necessary.
  158. X
  159. XXtNcursorStatus
  160. X    If this resource is false, or off, the text cursor is not displayed in the
  161. X    widget. By default the cursor is displayed.
  162. X
  163. XXtNkeyboardEvent XtNbuttonEvent XtNmotionEvent
  164. X    These three callbacks are used to notify the client of key, button and
  165. X    motion events. See below.
  166. X
  167. XXtNkey
  168. X    This is the string returned from XLookupKeysym when given the Keysym
  169. X    of a keyboard event. This resource is set each time a key is pressed
  170. X    or released. In many cases it will be the ASCII string of the key
  171. X    that was pressed.
  172. X
  173. XNOTE: Currently, if you change a PopScrollText's font or margins it DOES
  174. XNOT clear the window and force a redisplay. This allows you to display
  175. Xmultiple fonts in the same window, though you have to be careful about
  176. Xdoing so. If you do want only one font, then call XpwMClearWindow after
  177. Xeach font/margin change.
  178. X
  179. X
  180. X-- Handling Exposure Events -------------------------------------------
  181. X
  182. XExposure events happen when an area of the window that was occluded is
  183. Xmade visible by a raise/lower or map/unmap event. They also occur when a
  184. Xscroll operation is used on a region that is partially occluded. (This
  185. Xtype of exposure is called GraphicsExsposure).
  186. X
  187. XWhen repainting text in a PopScrollText widget, the following may be useful:
  188. X
  189. XThe simplist refresh algorithm would work as follows:
  190. X
  191. X  for each line on display
  192. X    if exposed_lines(line) is not 0 then
  193. X       refresh line
  194. X    endif
  195. X  endfor
  196. X
  197. XMore complex redraw algorithms could work out which part of the line
  198. Xneeds to be redrawn. The C macros:
  199. X
  200. X    int XpwExposeStart(line_entry)
  201. X    int XpwExposeEnd(line_entry)
  202. X
  203. XReturn the start and end column derived from an entry in the exposedLines
  204. Xresource. These can be used to calculate exactly which lines need to be
  205. Xredrawn.
  206. X
  207. X-- Actions ---------------------------------------------------------------
  208. X
  209. X
  210. XThe following actions call their associated callback list with data extracted
  211. Xfrom the event.
  212. X
  213. X Name                    Event               Call Data
  214. X -------------------     ------------------  ----------------------
  215. X notify-button-event     Button Events       Button number*
  216. X notify-key-event        Key Events          Keysym of key*
  217. X notify-motion-event     <Btn>Motion events  event->state@
  218. X
  219. X*Button number and Keysyms are signed integers. They are positive when
  220. X the button/key goes down and negative when the button/key comes up.
  221. X
  222. X@only calls the callback if mouseX and mouseY resources have changed, ie.
  223. X when the mouse moves into a new character cell.
  224. X
  225. XThe following additional actions are used by the PopScrollText widget:
  226. X
  227. X Name                    Event               Notes
  228. X ----                    ------------------  ---------------------
  229. X notify-graphics-expose  Graphics Expose     calls popCallback
  230. X highlight-cursor        Enter Window
  231. X unhighlight-cursor      Leave Window
  232. X
  233. X
  234. X-- PopScrollText Translations --------------------------------------------
  235. X
  236. XThe default translations for PopScrollText widgets are as follows:
  237. X
  238. X
  239. X    "<BtnDown>:        notify-button-event() \n\
  240. X     <BtnUp>:          notify-button-event() \n\
  241. X     <Keypress>:       notify-key-event() \n\
  242. X     <KeyRelease>:     notify-key-event() \n\
  243. X     <EnterWindow>:    highlight-cursor() \n\
  244. X     <LeaveWindow>:    unhighlight-cursor() \n\
  245. X     <GraphicsExpose>: notify-graphics-expose() \n\
  246. X     <Motion>:         notify-motion-event()";
  247. X
  248. X-- Methods  --------------------------------------------------------------
  249. X
  250. XThe PopScrollText widget responds to all of the PopCore methods. Additionally
  251. Xit responds to a set of methods that are used to manipulate the text on the
  252. Xwidget. The methods can be grouped as follows:
  253. X
  254. X    Scrolling methods
  255. X    Clearing methods
  256. X    Writing methods
  257. X    Cursor/Misc methods
  258. X
  259. XIn the case of Scrolling, Clearing and Writing, there is one primative
  260. Xgeneric method for each action, and several convenience methods that call
  261. Xthe generic method with calculated arguments. There are also several
  262. Xmethods that apply the generic Scrolling/Clearing/Writing method at the
  263. Xcurrent cursor location.
  264. X
  265. XMethod Name            Arguments                 Notes
  266. X========================================================================
  267. XXpwMScroll             col,row,cols,rows,x_dist,y_dist
  268. XXpwMScrollScreenUp     -
  269. XXpwMScrollScreenDown   -
  270. XXpwMScrollScreenLeft   -
  271. XXpwMScrollScreenRight  -
  272. XXpwMScrollLines        row, rows, dist
  273. XXpwMScrollTail         col, row, dist
  274. XXpwMScrollTails        col, row, rows, dist
  275. XXpwMScrollTailLeft     col, row
  276. XXpwMScrollTailRight    col, row
  277. XXpwMInsertLineAtCursor -
  278. XXpwMInsertCharAtCursor -
  279. XXpwMDeleteLineAtCursor -
  280. XXpwMDeleteCharAtCursor -
  281. XXpwMClear              col, row, cols, rows
  282. XXpwMClearWindow        -
  283. XXpwMClearLine          row
  284. XXpwMClearLines         row, rows
  285. XXpwMClearTail          col, row
  286. XXpwMClearTails         col, row, rows
  287. XXpwMClearChar          col, row
  288. XXpwMClearLineAtCursor  -
  289. XXpwMClearTailAtCursor  -
  290. XXpwMClearCharAtCursor  -
  291. XXpwMInsert             col, row, str, len
  292. XXpwMInsertAtCursor     str, len
  293. XXpwMWrite              col, row, index, lines, strs, off,len,clr
  294. XXpwMWriteLine          col, row, str, len, clr
  295. XXpwMWriteLines         col, row, index, lines, strs, len, clr
  296. XXpwMWriteSubstr        col, row, str, off, len, clr
  297. XXpwMWriteAtCursor      str, len
  298. XXpwMCursorTo           col,row
  299. XXpwMCursorUp           -
  300. XXpwMCursorDown         -
  301. XXpwMCursorLeft         -
  302. XXpwMCursorRight        -
  303. XXpwMBell               volume
  304. X
  305. X
  306. X-- Scroll Operations --------------------------------------------------
  307. X
  308. XXpwMScroll
  309. X    XpwCallMethod(widget,XpwMScroll, col,row,cols,rows,x_dist,y_dist);
  310. X    Widget widget;
  311. X    int col, row, cols, rows, x_dist, y_dist;
  312. X
  313. X    Scrolls the region starting at col, row, of width cols and height rows,
  314. X    by distance x_dist, y_dist. x_dist and y_dist can be positive or negative
  315. X    integers, and are measured in character cells. If cols or rows are zero,
  316. X    the current width/height of the window are used.
  317. X
  318. XXpwMScrollScreenUp
  319. XXpwMScrollScreenDown
  320. XXpwMScrollScreenLeft
  321. XXpwMScrollScreenRight
  322. X    XpwCallMethod(widget,XpwMScrollScreenUp);
  323. X    XpwCallMethod(widget,XpwMScrollScreenDown);
  324. X    XpwCallMethod(widget,XpwMScrollScreenLeft);
  325. X    XpwCallMethod(widget,XpwMScrollScreenRight);
  326. X    Widget widget;
  327. X
  328. X    Scroll the screen one character cell in each direction
  329. X
  330. XXpwMScrollLines
  331. X    XpwCallMethod(widget,XpwMScrollLines, row, rows, dist);
  332. X    Widget widget;
  333. X    int row, rows, dist;
  334. X
  335. X    Scroll the text starting at row and extending to row+rows by distance dist.
  336. X    Distance dist can be a positive or negative integer specifying the number
  337. X    of character cells to move the text up/down. If rows is zero, the current
  338. X    height of the window is used.
  339. X
  340. XXpwMScrollTail
  341. XXpwMScrollTails
  342. X    XpwCallMethod(widget,XpwMScrollTail, col, row, dist);
  343. X    XpwCallMethod(widget,XpwMScrollTails, col, row, rows, dist);
  344. X    Widget widget;
  345. X    int col, row, rows, dist;
  346. X
  347. X    Scroll all of the text to the left of col, on row (extending row+rows)
  348. X    left or right acording to distance dist. Dist is a positive or negative
  349. X    integer specifying the number of character cells to move the text.
  350. X    If rows is zero, the current height of the window is used.
  351. X
  352. XXpwMScrollTailLeft
  353. XXpwMScrollTailRight
  354. X    XpwCallMethod(widget,XpwMScrollTailLeft, col, row);
  355. X    XpwCallMethod(widget,XpwMScrollTailRight, col, row);
  356. X    Widget widget;
  357. X    int col, row;
  358. X
  359. X    Insert or delete a character at col,row by scrolling the tail of the
  360. X    line left or right by one character cell.
  361. X
  362. XXpwMInsertLineAtCursor
  363. X    XpwCallMethod(widget,XpwMInsertLineAtCursor);
  364. X    Widget widget;
  365. X
  366. X    Insert a line at the current cursor position by scrolling the text on
  367. X    that line, and lines below it, down.
  368. X
  369. XXpwMInsertCharAtCursor
  370. X    XpwCallMethod(widget,XpwMInsertCharAtCursor);
  371. X    Widget widget;
  372. X
  373. X    Insert a blank space at the current cursor location by moving the
  374. X    tail of the line right by one character cell.
  375. X
  376. XXpwMDeleteLineAtCursor
  377. X    XpwCallMethod(widget,XpwMDeleteLineAtCursor);
  378. X    Widget widget;
  379. X
  380. X    Remove a line at the cursor position by scrolling the text below the
  381. X    line up one character cell.
  382. X
  383. XXpwMDeleteCharAtCursor
  384. X    XpwCallMethod(widget,XpwMDeleteCharAtCursor);
  385. X    Widget widget;
  386. X
  387. X    Delete the character under the cursor by scrolling the text on the
  388. X    cursors line, after the cursors column, left one character cell.
  389. X
  390. X-- Clear Operations ---------------------------------------------------
  391. X
  392. XXpwMClear
  393. X    XpwCallMethod(widget,XpwMClear, col, row, cols, rows);
  394. X    Widget widget;
  395. X    int col, row, cols, rows;
  396. X
  397. X    Clear the region specified by (col, row, col+cols, row+rows). If cols or
  398. X    rows are zero, the current length of the window are used.
  399. X
  400. XXpwMClearWindow
  401. X    XpwCallMethod(widget,XpwMClearWindow);
  402. X    Widget widget;
  403. X
  404. X    Clear the whole window.
  405. X
  406. XXpwMClearLine
  407. X    XpwCallMethod(widget,XpwMClearLine, row);
  408. X    Widget widget;
  409. X    int row;
  410. X
  411. X    Clear the text on the specified row.
  412. X
  413. XXpwMClearLines
  414. X    XpwCallMethod(widget,XpwMClearLines, row, rows);
  415. X    Widget widget;
  416. X    int row, rows;
  417. X
  418. X    Clear the text on all lines starting at row, extending row+rows. If rows
  419. X    is zero, the height of the window is used instead.
  420. X
  421. XXpwMClearTail
  422. X    XpwCallMethod(widget,XpwMClearTail, col, row);
  423. X    Widget widget;
  424. X    int col, row;
  425. X
  426. X    Clears text to the left of col, on row.
  427. X
  428. XXpwMClearTails
  429. X    XpwCallMethod(widget,XpwMClearTails, col, row, rows);
  430. X    Widget widget;
  431. X    int col, row, rows;
  432. X
  433. X    Same as ClearTail for multiple lines. If rows is zero, the height of the
  434. X    window is used instead.
  435. X
  436. XXpwMClearChar
  437. X    XpwCallMethod(widget,XpwMClearChar, col, row);
  438. X    Widget widget;
  439. X    int col,row;
  440. X
  441. X    Clear the character cell (col, row).
  442. X
  443. X
  444. XXpwMClearLineAtCursor
  445. X    XpwCallMethod(widget,XpwMClearLineAtCursor);
  446. X    Widget widget;
  447. X
  448. X    Clears the text on the current cursor row.
  449. X
  450. XXpwMClearTailAtCursor
  451. X    XpwCallMethod(widget,XpwMClearTailAtCursor);
  452. X    Widget widget;
  453. X
  454. X    Clears the text to the left of the current cursor column, on the current
  455. X    cursor row.
  456. X
  457. XXpwMClearCharAtCursor
  458. X    XpwCallMethod(widget,XpwMClearCharAtCursor);
  459. X    Widget widget;
  460. X
  461. X    Clears the character under the cursor.
  462. X
  463. X-- Write Operations ---------------------------------------------------
  464. X
  465. XNOTE: For string operations, if a negative number is given as the length of
  466. Xthe string, the string is assumed to be a Poplog string, with its length
  467. Xstored two words before the start of the string pointer.
  468. X
  469. XXpwMWrite
  470. X    XpwCallMethod(widget,XpwMWrite, col, row, index, lines, strs, off,len,clr);
  471. X    Widget widget;
  472. X    String strs[];
  473. X    Boolean clr;
  474. X    int col, row, index, lines, off, len;
  475. X
  476. X    Takes an array of strings, strs. Takes an index into the array, and the
  477. X    number of lines from the array to draw. It starts at col, row on the
  478. X    screen and draws len characters of the string strs[index+line] starting
  479. X    at character off. If clr is true, the line is cleared first. This is
  480. X    repeated for the next line, on the next row. If len is zero, the
  481. X    string from character off onwards is drawn.
  482. X
  483. X
  484. XXpwMWriteLine
  485. X    XpwCallMethod(widget,XpwMWriteLine, col, row, str, len, clr);
  486. X    Widget widget;
  487. X    String str;
  488. X    Boolean clr;
  489. X    int col, row, len;
  490. X
  491. X    Writes len characters of the string str at col, row. If clr is true
  492. X    the line is cleared first. If len is zero, the whole string is drawn.
  493. X
  494. XXpwMWriteLines
  495. X    XpwCallMethod(widget,XpwMWriteLines,
  496. X        col, row, index, lines, strs, len, clr);
  497. X    Widget widget;
  498. X    String strs[];
  499. X    Boolean clr;
  500. X    int col, row, len, index, lines;
  501. X
  502. X    Same as WriteLine, only it takes an array of strings strs and starts at
  503. X    strs[index], continuing to strs[index+lines]. If len is zero, the
  504. X    whole string is drawn
  505. X
  506. X
  507. XXpwMWriteSubstr
  508. X    XpwCallMethod(widget,XpwMWriteSubstr, col, row, str, off, len, clr);
  509. X    Widget widget;
  510. X    String str;
  511. X    Boolean clr;
  512. X    int col, row, len, off;
  513. X
  514. X    Writes len characters of the string str starting at character off,
  515. X    at col, row of the window. If clr is true, the line is cleared first. If
  516. X    len is zero, the string from character off onwards is drawn.
  517. X
  518. XXpwMWriteAtCursor
  519. X    XpwCallMethod(widget,XpwMWriteAtCursor, str, len);
  520. X    Widget widget;
  521. X    String str;
  522. X    int len;
  523. X
  524. X    Writes the string str, of length len, at current cursors location. Moves
  525. X    cursor to end of string.
  526. X
  527. XXpwMInsert
  528. X    XpwCallMethod(widget,XpwMInsert, col, row, str, len);
  529. X    Widget widget;
  530. X    String str;
  531. X    int col, row, len;
  532. X
  533. X    Scrolls tail of text at col, row right by len characters, and then
  534. X    draws the string.
  535. X
  536. XXpwMInsertAtCursor
  537. X    XpwCallMethod(widget,XpwMInsertAtCursor, str, len);
  538. X    Widget widget;
  539. X    String str;
  540. X    int len;
  541. X
  542. X    Scrolls tail of text at the current cursor col and row right by len
  543. X    characters, and then draws the string at the cursor row and column.
  544. X    Moves the cursor to the end of the string.
  545. X
  546. X
  547. X-- Cursor and Misc Operations ------------------------------------------
  548. X
  549. XXpwMCursorTo
  550. X    XpwCallMethod(widget,XpwMCursorTo, col,row);
  551. X    Widget widget;
  552. X    int col, row;
  553. X
  554. X    Move the text cursor to col,row.
  555. X
  556. XXpwMCursorUp
  557. XXpwMCursorDown
  558. XXpwMCursorLeft
  559. XXpwMCursorRight
  560. X    XpwCallMethod(widget,XpwMCursorUp);
  561. X    XpwCallMethod(widget,XpwMCursorDown);
  562. X    XpwCallMethod(widget,XpwMCursorLeft);
  563. X    XpwCallMethod(widget,XpwMCursorRight);
  564. X    Widget widget;
  565. X
  566. X
  567. X    Move the text cursor one character cell in each direction.
  568. X
  569. XXpwMBell
  570. X    XpwCallMethod(widget,XpwMBell, volume);
  571. X    Widget widget;
  572. X    int volume;
  573. X
  574. X    Calls XBell to make a beep of the specified volume (0-100).
  575. END_OF_FILE
  576. if test 19823 -ne `wc -c <'doc/ref/PopScrollText'`; then
  577.     echo shar: \"'doc/ref/PopScrollText'\" unpacked with wrong size!
  578. fi
  579. # end of 'doc/ref/PopScrollText'
  580. fi
  581. if test -f 'doc/ref/PopText' -a "${1}" != "-c" ; then 
  582.   echo shar: Will not clobber existing file \"'doc/ref/PopText'\"
  583. else
  584. echo shar: Extracting \"'doc/ref/PopText'\" \(4153 characters\)
  585. sed "s/^X//" >'doc/ref/PopText' <<'END_OF_FILE'
  586. XREF *PopText                                   Jonathan Meyer, Jan 1990
  587. X
  588. XPoplog Widget Set, revision 3.
  589. X
  590. XThis file descibes the PopText widget. For information on the Pop-11 interface
  591. Xto this widget, see HELP *PopText. For an overview of Poplog Widgets, see
  592. XHELP *PopWidgets.
  593. X
  594. X-- PopText Widget -----------------------------------------------------
  595. X
  596. XSuperclass: (Athena) AsciiString Text
  597. X
  598. XThe PopText widget class is similar to PopCore and PopComposite in that
  599. Xit adds a callback action to an existing widget class (from the Athena
  600. XWidget Set). The callback is activated using an action in the
  601. Xtranslation table. The default translation table is show below. Users
  602. Xcan modify the translation table to trap specific events.
  603. X
  604. XThe PopText widget is useful in applications that want to use simple
  605. Xtext editors, and to be able to specify new methods for handling key and
  606. Xbutton events.
  607. X
  608. XThe PopText widget class variable is popTextWidgetClass.
  609. X
  610. XFor more information on the PopText widget, see the Athena Widget Set manual
  611. Xsection on the Text widget.
  612. X
  613. X
  614. X-- PopText Resources --------------------------------------------------
  615. X
  616. XPopText inherits the resources from the AsciiText and Text Athena widget
  617. Xclasses. The following new resources are retrieved from the resource database
  618. Xor argument list at widget creation:
  619. X
  620. X=========================================================================
  621. XName          Class      RepType    Default  Description
  622. X=========================================================================
  623. XpopCallback   Callback   Pointer    NULL     Callback for Key/Btn events
  624. X
  625. XThe popCallback callback is used to notify applications of events.
  626. X
  627. X-- PopText Actions and Translations -----------------------------------
  628. X
  629. XThe PopText widget class has one additional action to the text widget
  630. Xclass, called "notify-event". This action calls the 'popCallback' list,
  631. Xpassing the event to the callback list. The notify-event action can be
  632. Xspecified in the translations table to trap keys and buttons that the
  633. Xapplication specifies. The default translations are:
  634. X
  635. Xstatic char defaultTranslations[] = "
  636. XCtrl<Key>F:    forward-word() \n\
  637. XCtrl<Key>B:    backward-word() \n\
  638. XCtrl<Key>C: notify-event(CTR_C) \n\
  639. XCtrl<Key>D:    notify-event(CTR_D) \n\
  640. XCtrl<Key>A:    beginning-of-line() \n\
  641. XCtrl<Key>E:    kill-to-end-of-line() \n\
  642. XCtrl<Key>H:    delete-previous-character() \n\
  643. XCtrl<Key>J:    newline-and-indent() \n\
  644. XCtrl<Key>K:    backward-paragraph() \n\
  645. XCtrl<Key>L:    forward-paragraph() \n\
  646. XCtrl<Key>M: newline() \n\
  647. XCtrl<Key>P:    delete-next-character() \n\
  648. XCtrl<Key>V:    next-line() \n\
  649. XCtrl<Key>W:    kill-selection() \n\
  650. XCtrl<Key>Y:    unkill() \n\
  651. XCtrl<Key>Z:    scroll-one-line-up() \n\
  652. X<Key>Escape: notify-event(ESC) \n\
  653. X<Key>Right:    forward-character() \n\
  654. X<Key>Left:    backward-character() \n\
  655. X<Key>Down:    next-line() \n\
  656. X<Key>Up:    previous-line() \n\
  657. X<Key>Delete:    delete-previous-character() \n\
  658. X<Key>BackSpace:    delete-previous-character() \n\
  659. X<Key>Linefeed:    newline-and-indent() \n\
  660. X<Key>Return:    newline() \n\
  661. X<Key>F1:    select-start() \n\
  662. X<Key>F2:    select-end() \n\
  663. X<Key>F3:    backward-kill-word() \n\
  664. X<Key>F4:    beginning-of-line() kill-to-end-of-line() delete-previous-character()\n\
  665. X<Key>F5:    kill-to-end-of-line() \n\
  666. X<Key>F6:    backward-kill-word() \n\
  667. X<Key>F7:    kill-word() \n\
  668. X<Key>F8:    kill-selection() insert-selection()\n\
  669. X<Key>F9:    stuff() \n\
  670. X<Key>R1:    beginning-of-line() \n\
  671. X<Key>R2:    previous-page() \n\
  672. X<Key>R3:    end-of-line() \n\
  673. X<Key>R4:    beginning-of-line() \n\
  674. X<Key>R5:    next-page() \n\
  675. X<Key>R6:    end-of-line() \n\
  676. X<Key>R7:    backward-character() previous-line() \n\
  677. X<Key>R9:    forward-character() previous-line() \n\
  678. X<Key>R13:    backward-character() next-line() \n\
  679. X<Key>R15:    forward-character() next-line() \n\
  680. X<Key>:        insert-char() \n\
  681. X<FocusIn>:    focus-in() \n\
  682. X<FocusOut>:    focus-out() \n\
  683. XCtrl<Btn1Down>: notify-event(BTN1) \n\
  684. XCtrl<Btn2Down>: notify-event(BTN2) \n\
  685. XCtrl<Btn3Down>: notify-event(BTN3) \n\
  686. X<Btn1Down>:    select-start() \n\
  687. X<Btn1Motion>:    extend-adjust() \n\
  688. X<Btn1Up>:    extend-end(PRIMARY, CUT_BUFFER0) \n\
  689. X<Btn2Down>:    insert-selection(PRIMARY, CUT_BUFFER0) \n\
  690. X<Btn3Down>:    extend-start() \n\
  691. X<Btn3Motion>:    extend-adjust() \n\
  692. X<Btn3Up>:    extend-end(PRIMARY, CUT_BUFFER0) "
  693. X
  694. X
  695. END_OF_FILE
  696. if test 4153 -ne `wc -c <'doc/ref/PopText'`; then
  697.     echo shar: \"'doc/ref/PopText'\" unpacked with wrong size!
  698. fi
  699. # end of 'doc/ref/PopText'
  700. fi
  701. if test -f 'doc/ref/XpwCallMethod' -a "${1}" != "-c" ; then 
  702.   echo shar: Will not clobber existing file \"'doc/ref/XpwCallMethod'\"
  703. else
  704. echo shar: Extracting \"'doc/ref/XpwCallMethod'\" \(1287 characters\)
  705. sed "s/^X//" >'doc/ref/XpwCallMethod' <<'END_OF_FILE'
  706. XHELP *XpwCallMethod                             Jonathan Meyer, Jan 1990
  707. X
  708. X
  709. XPoplog Widget Set, revision 3.
  710. X
  711. XXpwCallMethod is a C procedure that takes a widget, a method ID, and
  712. Xa variable number of arguments according to the method.
  713. X
  714. XIf the widget is a subclass of the PopCore widget class, XpwCallMethod
  715. Xlooks for the specified method ID in a table held in the widgets class
  716. Xstructure, and in the class structure of its superclasses.
  717. X
  718. XIf the method ID is found in the table, the associated method procedure
  719. Xis extracted and called.
  720. X
  721. XFor more information on the methods available to Poplog Widgets, see
  722. XHELP *XpwMethods. For more information on the methods calling technique
  723. Xsee SYSDOC *PopWidgets.imp. HELP *PopWidgets gives an overview of the
  724. XPoplog Widget Set.
  725. X
  726. XThe XpwCallMethod procedure is externally loaded into Pop-11. Because it
  727. Xtakes a variable number of arguments, which can be of different types,
  728. XLIB *EXTERNAL is NOT used. This means that, to use XpwCallMethod, you
  729. Xmust specify two extra arguments, telling external_apply how many
  730. Xarguments you are passing to C and whether the method returns a value or not.
  731. XFor Example, the call:
  732. X
  733. X   XpwCallMethod(w, XpwMDrawPoint, 10,10,      4, false)
  734. X
  735. XCalls the C XpwCallMethod procedure with 4 arguments, and does not return
  736. Xa value.
  737. END_OF_FILE
  738. if test 1287 -ne `wc -c <'doc/ref/XpwCallMethod'`; then
  739.     echo shar: \"'doc/ref/XpwCallMethod'\" unpacked with wrong size!
  740. fi
  741. # end of 'doc/ref/XpwCallMethod'
  742. fi
  743. if test -f 'doc/ref/XpwMethods' -a "${1}" != "-c" ; then 
  744.   echo shar: Will not clobber existing file \"'doc/ref/XpwMethods'\"
  745. else
  746. echo shar: Extracting \"'doc/ref/XpwMethods'\" \(3715 characters\)
  747. sed "s/^X//" >'doc/ref/XpwMethods' <<'END_OF_FILE'
  748. XREF *XpwMethods                               Jonathan Meyer, Jan 1990
  749. X
  750. XPoplog Widget Set, revision 3.
  751. X
  752. XThis file describes the methods available to Poplog Widgets. Methods are
  753. Xlike procedures except that a specific widget class can have several
  754. Xprocedures that get called when one method is invoked (methods are
  755. Xsubclass-to-superclass chained, so each superclass of a widget can have
  756. Xan interpretation for a method). Methods are invoked using XpwCallMethod.
  757. XSee REF *XpwCallMethod for more information on calling methods, or
  758. XSYSDOC *PopWidgets.imp for information about how methods are implemented.
  759. X
  760. X
  761. XThe methods listed here are desribed in more detail in the relevant
  762. XREF file.
  763. X
  764. X
  765. XPopCore Methods (See REF *PopCore)
  766. X
  767. XMethod Name         Arguments                 Notes
  768. X========================================================================
  769. XXpwMSetColor        string                    either name or #rgb format
  770. XXpwMFreeColor       string
  771. XXpwMSetFont         string
  772. XXpwMFreeFont        string
  773. XXpwMSetCursor       shape                     shape in cursorfont.h
  774. XXpwMFreeCursor      shape                     eg. XC_crosshair
  775. X
  776. X
  777. XPopPixmap Methods (See REF *PopPixmap)
  778. X
  779. XMethod Name         Arguments                 Notes
  780. X========================================================================
  781. XXpwMDrawArc         x,y,w,h,a1,a2
  782. XXpwMDrawArcs        arcs,narcs
  783. XXpwMDrawLine        x,y,w,h
  784. XXpwMDrawPoint       x,y
  785. XXpwMDrawPoints      pts,npts
  786. XXpwMDrawRectangle   x,y,w,h
  787. XXpwMDrawRectangles  recs,nrecs
  788. XXpwMDrawSegments    segs,nsegs
  789. XXpwMFillArc         x,y,w,h,a1,a2
  790. XXpwMFillArcs        arcs,narcs
  791. XXpwMFillPolygon     pts,npts,shape,mode
  792. XXpwMFillRectangle   x,y,w,h
  793. XXpwMFillRectangles  recs,nrecs
  794. XXpwMDrawString      x,y,str,len
  795. XXpwMDrawImageString x,y,str,len
  796. XXpwMPutImage        image,sx,sy,ex,ey,w,h
  797. XXpwMGetImage        x,y,w,h,msk,format
  798. XXpwMClearArea       x,y,w,h
  799. XXpwMClearWindow     none
  800. XXpwMDrawImage       x,y,w,h,data
  801. XXpwMCopyFrom        src_widget,x,y,w,h,ex,ey
  802. XXpwMCopyTo          dst_widget,x,y,w,h,ex,ey
  803. X
  804. X
  805. XPopGraphic Methods (See REF *PopGraphic)
  806. X
  807. XMethod Name         Arguments                  Notes
  808. X========================================================================
  809. XXpwMAllocColorRange num,r1,g1,b1,r2,g2,b2
  810. XXpwMAllocStoreColor r,g,b
  811. XXpwMCreateColormap  -
  812. XXpwMFreeColormap    -
  813. X
  814. X
  815. XPopScrollText Methods (See REF *PopScrollText)
  816. X
  817. XMethod Name            Arguments                 Notes
  818. X========================================================================
  819. XXpwMScroll             col,row,cols,rows,x_dist,y_dist
  820. XXpwMScrollScreenUp     -
  821. XXpwMScrollScreenDown   -
  822. XXpwMScrollScreenLeft   -
  823. XXpwMScrollScreenRight  -
  824. XXpwMScrollLines        row, rows, dist
  825. XXpwMScrollTail         col, row, dist
  826. XXpwMScrollTails        col, row, rows, dist
  827. XXpwMScrollTailLeft     col, row
  828. XXpwMScrollTailRight    col, row
  829. XXpwMInsertLineAtCursor -
  830. XXpwMInsertCharAtCursor -
  831. XXpwMDeleteLineAtCursor -
  832. XXpwMDeleteCharAtCursor -
  833. XXpwMClear              col, row, cols, rows
  834. XXpwMClearWindow        -
  835. XXpwMClearLine          row
  836. XXpwMClearLines         row, rows
  837. XXpwMClearTail          col, row
  838. XXpwMClearTails         col, row, rows
  839. XXpwMClearChar          col, row
  840. XXpwMClearLineAtCursor  -
  841. XXpwMClearTailAtCursor  -
  842. XXpwMClearCharAtCursor  -
  843. XXpwMInsert             col, row, str, len
  844. XXpwMInsertAtCursor     str, len
  845. XXpwMWrite              col, row, index, lines, strs, off,len,clr
  846. XXpwMWriteLine          col, row, str, len, clr
  847. XXpwMWriteLines         col, row, index, lines, strs, len, clr
  848. XXpwMWriteSubstr        col, row, str, off, len, clr
  849. XXpwMWriteAtCursor      str, len
  850. XXpwMCursorTo           col,row
  851. XXpwMCursorUp           -
  852. XXpwMCursorDown         -
  853. XXpwMCursorLeft         -
  854. XXpwMCursorRight        -
  855. XXpwMBell               volume
  856. END_OF_FILE
  857. if test 3715 -ne `wc -c <'doc/ref/XpwMethods'`; then
  858.     echo shar: \"'doc/ref/XpwMethods'\" unpacked with wrong size!
  859. fi
  860. # end of 'doc/ref/XpwMethods'
  861. fi
  862. if test -f 'doc/ref/XpwResources' -a "${1}" != "-c" ; then 
  863.   echo shar: Will not clobber existing file \"'doc/ref/XpwResources'\"
  864. else
  865. echo shar: Extracting \"'doc/ref/XpwResources'\" \(5311 characters\)
  866. sed "s/^X//" >'doc/ref/XpwResources' <<'END_OF_FILE'
  867. XREF *XpwResources                               Jonathan Meyer, Mar 1990
  868. X
  869. XPoplog Widget Set, revision 3.
  870. X
  871. XThis file provides an index to the resources used in the Poplog Widget Set.
  872. XFor information about the Poplog Widget Set, see HELP *PopWidgets.
  873. XResources can be set and examined using XtGetValues and XtSetValues,
  874. Xor using LIB *XT_VALUE.
  875. X
  876. XCore and PopCore Resources (See REF *PopCore)
  877. X
  878. X===============================================================================
  879. XName            Class        RepType    Default*   Description
  880. X===============================================================================
  881. XXtNwidth        Width        Dimension  200        Window width
  882. XXtNheight       Height       Dimension  100        Window height
  883. XXtNx            X            Position   0          X coordinate in pixels 
  884. XXtNy            Y            Position   0          Y coordinate in pixels
  885. XXtNborderWidth  BorderWidth  Dimension  1          Border width in pixels
  886. XXtNborderPixmap BorderPixmap Pixmap     None       Window border pixmap
  887. XXtNborderColor  BorderColor  Pixel      foreground Window border color
  888. XXtNbackground   Background   Pixel      XtDefault  Window background color
  889. XXtNforeground   Foreground   Pixel      XtDefault  Window foreground color
  890. XXtNfont         Font         FontStruct XtDefault  Font for text operations
  891. XXtNpointerShape Cursor       Cursor     None       mouse cursor(cursorfont)
  892. XXtNtranslations Translations String                Event-to-action translations
  893. XXtNpopCallback  Callback     Pointer    NULL       Callbacks for events
  894. XXtNautoFlush    Boolean      Boolean    TRUE       XFlush after methods?
  895. XXtNusersGC      GC           Pointer    NULL       Graphics Context for ops
  896. XXtNmodifiers    Parameter    Int        None       event->state modifiers
  897. XXtNdestroyCallback           Callback   NULL       XtDestroyWidget callback
  898. XXtNmappedWhenManaged         Boolean    TRUE       automatic XtMapWidget
  899. X
  900. X
  901. XPopPixmap resources (See REF *PopPixmap)
  902. X
  903. X===============================================================================
  904. XName            Class        RepType    Default*   Description
  905. X===============================================================================
  906. XXtNfunction      Function      Int      XtDefault  GC drawing mode
  907. XXtNsubwindowMode SubWindowMode Int      XtDefault  GC subwindow mode
  908. XXtNlineWidth     LineWidth     Int      XtDefault  GC line width
  909. XXtNlineStyle     LineStyle     Int      XtDefault  GC line style
  910. XXtNcapStyle      CapStyle      Int      XtDefault  GC cap style
  911. XXtNjoinStyle     JoinStyle     Int      XtDefault  GC join style
  912. XXtNprivateGC     GC            Pointer  None       Pixmap Graphics Context
  913. XXtNpixmap        Pixmap        Pointer  None       Pixmap of Widget.
  914. XXtNpixmapStatus  PixmapStatus  Cardinal PixmapOn   Is Pixmap active?
  915. X
  916. X
  917. XPopGraphic resources (See REF *PopGraphic)
  918. X
  919. X===============================================================================
  920. XName            Class        RepType    Default*   Description
  921. X===============================================================================
  922. XXtNusePrivateGC  Boolean       Boolean    TRUE       See below
  923. XXtNmyGC          GC            Pointer    NULL       GC for window refresh
  924. XXtNswitchCmaps   Boolean       Boolean    FALSE      Automatic cmap install
  925. XXtNmouseX        MouseLocation Int        None       Mouse X location in pixels
  926. XXtNmouseY        MouseLocation Int        None       Mouse Y location in pixels
  927. XXtNbuttonEvent   Callback      Pointer    NULL       Called on ButtonPress
  928. XXtNkeyboardEvent Callback      Pointer    NULL       Called on KeyPress
  929. XXtNmouseEvent    Callback      Pointer    NULL       Called on Enter/Leave
  930. XXtNmotionEvent   Callback      Pointer    NULL       Called on mouse Motion
  931. XXrNresizeEvent   Callback      Pointer    NULL       Called on Resize Req
  932. X
  933. X
  934. XPopScrollText resources (See REF *PopScrollText)
  935. X
  936. X========================================================================
  937. XName             Class        RepType    Default*   Description
  938. X========================================================================
  939. XXtNtopMargin     TopMargin    Dimension  0          Distance to start of text
  940. XXtNleftMargin    LeftMargin   Dimension  2          Distance to start of text
  941. XXtNfontWidth     Width        Dimension  None       Width of current font
  942. XXtNfontHeight    Height       Dimension  None       Height of current font
  943. XXtNcursorRow     Position     Position   0          Cursors Y location
  944. XXtNcursorColumn  Position     Position   0          Cursors X location
  945. XXtNcursorStatus  CursorStatus Boolean    TRUE       Cursor on/off
  946. XXtNmouseX        MouseLocation Int       None       Mouse column
  947. XXtNmouseY        MouseLocation Int       None       Mouse row
  948. XXtNnumRows       Dimension    Dimension  24         Text columns
  949. XXtNnumColumns    Dimension    Dimension  80         Text rows
  950. XXtNexposedLines  Parameter    (int *)    NULL       Lines that need redrawing
  951. XXtNkey           Key          String     NULL       Ascii string of KeyPress
  952. XXtNkeyboardEvent Callback     Callback   NULL       keyboard inputs callback
  953. XXtNbuttonEvent   Callback     Callback   NULL       Mouse buttonpress events
  954. XXtNmotionEvent   Callback     Callback   NULL       Mouse motion events
  955. XXtNdestroyCallback            Callback   NULL       XtDestroyWidget callback
  956. END_OF_FILE
  957. if test 5311 -ne `wc -c <'doc/ref/XpwResources'`; then
  958.     echo shar: \"'doc/ref/XpwResources'\" unpacked with wrong size!
  959. fi
  960. # end of 'doc/ref/XpwResources'
  961. fi
  962. if test -f 'doc/man/poplog.man' -a "${1}" != "-c" ; then 
  963.   echo shar: Will not clobber existing file \"'doc/man/poplog.man'\"
  964. else
  965. echo shar: Extracting \"'doc/man/poplog.man'\" \(12604 characters\)
  966. sed "s/^X//" >'doc/man/poplog.man' <<'END_OF_FILE'
  967. X.TH POPLOG 1 "December 1989" "Poplog V13.66"
  968. X
  969. XPoplog \- a multi\-language interactive software development environment
  970. X
  971. X.SH SYNOPSIS
  972. X.B pop11 [ \fI\+saved-image\fP ... ]
  973. X[ \fI argument .\.\.\fP ]
  974. X[ \fI :command\fP ]
  975. X.LP
  976. X.B ved [ \fIfilename\fP ]
  977. X.LP
  978. X.B prolog [ \fI\-|\+saved-image\fP ]
  979. X.LP
  980. X.B clisp [ \fI\-|\+saved-image\fP ]
  981. X.LP
  982. X.B pml [ \fI\-|\+saved-image\fP ]
  983. X.LP
  984. X.SH DESCRIPTION
  985. X
  986. X\fIPoplog\fP is an integrated, interactive, multi-language software
  987. Xdevelopment environment. It provides incremental compilers for POP-11,
  988. XPROLOG, COMMON LISP and ML. Features include a powerful extensible
  989. Xmulti-window text editor (\fIVed\fP), over 1700 documentation files, the \fI
  990. XPoplog Window Manager\fP (\fIPwm\fP), many demonstration and utility
  991. Xlibraries including an object oriented extension to Pop-11 known as
  992. X\fIFlavours\fP, compiler-building tools, and mechanisms for dynamically linking
  993. XPASCAL, FORTRAN and C programs so that they can be called from \fIPoplog\fP.
  994. XIt includes the source code for a large number of library packages, which are
  995. Xusually \fIPop-11\fP programs that the user can read and modify.
  996. X.LP
  997. XAt the heart of \fIPoplog\fP is the \fIPoplog Virtual Machine\fP. The
  998. X\fIPoplog\fP compilers translate program text and into a sequence of \fIPoplog
  999. XVirtual Machine\fP (\fIVM\fP) instructions, that are in turn compiled into
  1000. Xreal machine code instructions. This system provides the programmer with a
  1001. Xsuitable environment for rapid-prototyping, whilst also ensuring efficient
  1002. Xcode execution. The provision of the \fIPoplog Virtual Machine\fP as a target
  1003. Xfor compilers simplifies porting of Poplog languages, and programs written
  1004. Xusing them, to new machines.
  1005. X
  1006. XPrograms written using AlphaPop on a Macintosh will run on implementations
  1007. Xof Poplog on
  1008. XWorkstations running UNIX, and DEC VAX machines running VMS. A list of
  1009. Xcurrently supported hardware bases is available (see below for address).
  1010. X.LP
  1011. XThe \fIPoplog Virtual Machine\fP provides support for a large variety of
  1012. Xdatatypes, including linked lists, arrays, strings, integers and floating
  1013. Xpoint numbers. Users can define new datatypes. \fIPoplog\fP variables and
  1014. Xconstants can either be dynamically or lexically scoped, and are weakly typed.
  1015. X\fIPoplog\fP provides a trace and debugging facilities. It also has a very
  1016. Xefficient storage manager, using a mark-and-sweep copying garbage collector,
  1017. Xwhich is automatically replaced by a non-copying algorithm when there is not
  1018. Xenough space for copying. \fIPop-11\fP processes start from under a megabyte
  1019. Xin size. Prolog, Lisp or ML require more, but all start in less than two
  1020. Xmegabytes. Poplog processes can grow to whatever size the machine and the
  1021. Xoperating system will allow.
  1022. X.LP
  1023. XThe core language of \fIPoplog\fP is \fIPop-11\fP. \fIPop-11\fP combines the
  1024. Xfeatures found in other AI languages like Lisp with a syntax that is similar
  1025. Xin form to Pascal or C. \fIPop-11\fP code is easy to read, and includes many
  1026. Xcontrol structures. For example, the following \fIPop-11\fP code prints the
  1027. Xword "hello" out five times:
  1028. X.sp
  1029. X.in +8
  1030. X.nf
  1031. Xrepeat 5 times
  1032. X    "hello" =>   ;;; print hello out five times
  1033. Xendrepeat;
  1034. X.fi
  1035. X.in -8
  1036. X.LP
  1037. XBecause the syntax of \fIPop-11\fP is very readable, it is easy to learn, and
  1038. Xhas been found to be very effective as a teaching tool. However, \fIPop-11\fP
  1039. Xprogrammers can also make use of rich syntactic structures, and the large
  1040. Xnumbers of utilities, to write very complex and diverse packages. Since the
  1041. Xeditor, the compiler and the debugging tools are all part of the same
  1042. Xenvironment, programmers are saved from the laborious task of switching
  1043. Xbetween editors and compilers, waiting for error messages from the compilers,
  1044. Xand switching back to the editor again.
  1045. X.LP
  1046. X\fIPoplog\fP is far too complex to describe fully in a manual page entry. This
  1047. Xdocument serves only as a pointer to the large amount of on-line documentation
  1048. Xthat is available within the \fIPoplog\fP environment.
  1049. X.SH COMMANDS
  1050. X.LP
  1051. X.TP
  1052. X.I pop11
  1053. XLoads the default \fIPoplog\fP system, with only the \fIPop-11\fP compiler.
  1054. X.TP
  1055. X.I  ved
  1056. XFirst loads the default \fIPoplog\fP system, with the \fIPop-11\fP compiler,
  1057. Xand then loads the \fIPoplog\fP editor, \fIVed\fP. This command can take one
  1058. Xargument (a filename) that is passed to \fIVed\fP as the name of the initial
  1059. Xfile to edit.
  1060. X.TP
  1061. X.I prolog, pop11 +prolog
  1062. XFirst loads the default \fIPoplog\fP system, with the \fIPop-11\fP compiler,
  1063. Xand then starts the \fIProlog\fP compiler (provided as a saved image).
  1064. X.TP
  1065. X.I clisp, pop11 +lisp
  1066. XFirst loads the default \fIPoplog\fP system, with the \fIPop-11\fP compiler,
  1067. Xand then starts the \fICommon Lisp\fP compiler (provided as a saved image).
  1068. X.TP
  1069. X.I pml, pop11 +pml
  1070. XFirst loads the default \fIPoplog\fP system, with the \fIPop-11\fP compiler,
  1071. Xand then starts the \fIML\fP compiler.
  1072. X.in -8
  1073. X.SH OPTIONS
  1074. X.LP
  1075. XFor more information on \fIPoplog\fP parameter passing, see the Poplog
  1076. Xhelp file HELP\ PARAMETERS, or the more detailed specification in
  1077. XREF \SYSTEM.
  1078. X.TP
  1079. X\fI+saved-image\fP ...
  1080. XLoads the \fIPoplog\fP environment and then looks for the specified
  1081. X\fIPoplog\fP saved image. \fIPoplog\fP will search the directories specified
  1082. Xin \fI$popsavepath\fP, and in the current directory. The suffix .psv is added
  1083. Xto the filename if no suffix is specified. Several incremental saved images
  1084. Xcan be loaded using the "+saved-image" form. Additional arguments specified
  1085. Xusing the "-" flag will be passed into the \fIPoplog\fP environment. By
  1086. Xdefault, such arguments are ignored, although the programmer may wish to
  1087. Xdefine interpretations for them. If this option is given the \fI:command\fP
  1088. Xoption must be omitted. For more information about saved images, see REF\
  1089. XSYSTEM.
  1090. X.TP
  1091. X.I :command
  1092. XLoads the \fIPoplog\fP environment, and then executes the \fIPop-11\fP
  1093. Xinstruction \fIcommand\fP.
  1094. X.TP
  1095. Xved \fIfilename\fP
  1096. XLoads the \fIPoplog\fP environment, sets up the editor (\fIVed\fP), and
  1097. Xreads \fIfilename\fP into a ved buffer, ready for editing.
  1098. X
  1099. X.SH POPLOG INITIALIZATION
  1100. X
  1101. X\fIPoplog\fP uses environent variables to store information about the location
  1102. Xof files, defaults and documentation. These variables are usually initialized
  1103. Xusing a shell script. For details see your local system administrator or the
  1104. X\fIPoplog Users' Guide\fP. The \fIGuide\fP also explains how to use
  1105. Xinitialization files, such as init.p, vedinit.p, init.pl, init.lsp, and
  1106. Xinit.ml. Default scripts reside in the pop/com directory of the \fIPoplog\fP
  1107. Xtree. These scripts are usually executed as part of the users \fI.login\fP
  1108. Xscript. A typical login script would contain the following:
  1109. X.LP
  1110. X.ti+8n
  1111. X\fBsetenv usepop /usr/local/pop13.66 (or whatever)\fP
  1112. X.ti+8n
  1113. X\fBsource $usepop/pop/com/poplog\fP
  1114. X.LP
  1115. X
  1116. X\fIPoplog\fP initialization often prints out a message giving the Poplog
  1117. Xversion, and adds the \fIPoplog\fP executables to the users PATH.
  1118. X.LP
  1119. XFor more information, contact your system administrator, or see the User Guide,
  1120. Xor the online information in POPLOG HELP\ INITIAL.
  1121. X.LP
  1122. X.SH ENVIRONMENT VARIABLES
  1123. X.TP
  1124. X.I $usepop
  1125. XHolds the path to the root of the \fIPoplog\fP directory tree.
  1126. X.TP
  1127. X.I $poplocal
  1128. XHolds the path to the root of the \fIPoplog\fP local tree. This is used to
  1129. Xstore site-specific libraries and documentation.
  1130. X.TP
  1131. X.I $popcom
  1132. XSet to \fI$usepop\fP/pop/com. This directory holds several csh(1) scripts for
  1133. Xmaking default saved images, and setting up the poplog environment.
  1134. X.TP
  1135. X.I $popsrc
  1136. XSet to \fI$usepop\fP/pop/src. This directory contains the sources for the
  1137. X\fIPoplog\fP environment, if provided. The sources may be in object file form.
  1138. X.TP
  1139. X.I $popsys
  1140. XSet to \fI$usepop\fP/pop/pop. Contains the \fIPoplog\fP executable commands,
  1141. Xincluding \fIpop11\fP, \fIprolog\fP, \fIpml\fP, \fIclisp\fP. Other commands
  1142. Xinclude:
  1143. X.sp
  1144. X.in +8
  1145. X.nf
  1146. X.ig
  1147. X\fIteach\fP evokes \fIVed\fP with the TEACH *TEACH file.
  1148. X\fIhelp\fP evokes \fIVed\fP with the HELP *TEACH file.
  1149. X..
  1150. X\fIpwmtool\fP runs the Suntools Poplog Window Manager.
  1151. X.ig
  1152. X\fIv55\fP loads \fIVed\fP with the Visual 55 terminal setup.
  1153. X\fIeliza\fP loads and runs the demo program Eliza.
  1154. X..
  1155. X.fi
  1156. X.in -8
  1157. X.TP
  1158. X.I $popautolib, $poplocalauto
  1159. XSet to $usepop/pop/lib/auto and $poplocal/local/auto respectively. The
  1160. Xcompiler searches these directories when it is trying to evaluate an undefined
  1161. Xidentifier. If a file is found with the same name as the identifier, it is
  1162. Xcompiled. This enables the Poplog environment to be invisibly extended, whilst
  1163. Xconserving memory usage.
  1164. X.TP
  1165. X.I $poplocalbin
  1166. XDirectory containing local saved images.
  1167. X.TP
  1168. X.I $popliblib, $popdatalib, $poppwmlib, $popsunlib, $popvedlib
  1169. XSet to directories containing library packages for Pop-11, Pwm, Sun consoles
  1170. Xand Ved.
  1171. X.TP
  1172. X.I $popsavelib
  1173. XSet to $usepop/pop/psv. This directory contains some standard saved images,
  1174. Xincluding the Prolog, Lisp and ML saved images.
  1175. X.TP
  1176. X.I $popsavepath
  1177. XLists of directories containing Poplog saved images. Users may add paths to
  1178. Xdirectories containing their own saved images. By default, this is set to
  1179. X$poplib:$poplocalbin:$popsavelib.
  1180. X.TP
  1181. X.I $poplib
  1182. XUser definable. Holds the path to the users library directory. \fIPoplog\fP
  1183. Xwill look in this directory for saved images and initialization files (see
  1184. Xbelow).
  1185. X.TP
  1186. X.I $pop_{name}
  1187. XWhen \fIPoplog\fP is executed, it checks the name of the command that it was
  1188. Xexecuted by (ie. argv[0]). If this command was not "pop11", \fIPoplog\fP looks
  1189. Xfor an environment variable starting with "pop_" and ending with argv[0]. If
  1190. Xsuch a variable exists, \fIPoplog\fP treats the contents of the variable as
  1191. Xthe arguments to \fIPoplog\fP. This is a convenient way of making new
  1192. Xcommands. To make a command myved, which loads pop11 with the saved image
  1193. Xcalled myved.psv, make a symbolic link between $popsys/pop11 and myved, and
  1194. Xset the environment variable pop_myved to "+myved":
  1195. X.sp
  1196. X.in +8
  1197. X.nf
  1198. Xln -s $popsys/pop11 myved
  1199. Xsetenv pop_myved +myved
  1200. X.fi
  1201. X.in -8
  1202. X.LP
  1203. X.SH FILES
  1204. X
  1205. X.TP
  1206. X.I $poplib/init.p
  1207. XAfter \fIPoplog\fP is loaded, the \fIPop-11\fP code in this file is compiled.
  1208. XUsers can use this file define useful procedures and variables to tailor the
  1209. X\fIPoplog\fP environment to their own tastes.
  1210. X.TP
  1211. X.I $poplib/vedinit.p
  1212. XThis \fIPop-11\fP file is compiled when the \fIVed\fP editor is evoked. Users
  1213. Xcan write programs to tailor the operation of \fIVed\fP, so that for example
  1214. Xit behaves sensibly when different terminals are being used. This file can
  1215. Xalso be used to define extra VED <ENTER> commands, or to modify the default
  1216. Xactions that \fIVed\fP takes when a new file is edited (see
  1217. XHELP\ VEDFILETYPES, HELP\ VEDVEDDEFAULTS).
  1218. X.TP
  1219. X.I $poplib/init.pl
  1220. XA file containing PROLOG code that is compiled when \fIPoplog\fP is loaded
  1221. Xwith the PROLOG compiler.
  1222. X.TP
  1223. X.I $poplib/init.lsp
  1224. XA file containing LISP code that is compiled when \fIPoplog\fP is loaded with
  1225. Xthe LISP compiler.
  1226. X.TP
  1227. X.I $poplib/init.ml
  1228. XA file containing ML code that is compiled when \fIPoplog\fP is loaded with
  1229. Xthe ML compiler.
  1230. X.LP
  1231. XAll of the above files are optional. If \fIPoplog\fP does not find them in the
  1232. X$poplib directory, it searches the current directory.
  1233. X
  1234. X.SH BUGS
  1235. X.LP
  1236. XThe \fIPoplog\fP help file HELP *NEWS provides the latest information on
  1237. Xproblems and changes in Poplog. Academic sites can mail Sussex University
  1238. X(address below) with their problems. Other sites should contact ISL. Some
  1239. Xsites may also have a bugreport mechanism, which automatically posts E-mail
  1240. Xproblems to Sussex University. See HELP *bugreport, or contact your System
  1241. XAdministrator.
  1242. X
  1243. X.LP
  1244. X.SH "SEE ALSO"
  1245. X
  1246. X
  1247. X.IB Poplog\  HELP\  files:
  1248. X.LP
  1249. XHELP *INITIAL, REF *SYSPEC, HELP *POPLOG, TEACH *TEACH, REF *SYSTEM
  1250. X.LP
  1251. XB. R. Barret, A. Ramsey and A. Sloman, \fI POP-11, A practical Language for
  1252. XArtificial Intelligence\fP, Ellis Horwood, 1986.
  1253. X.LP
  1254. X.SH FURTHER INFORMATION
  1255. X.LP
  1256. X\fIPoplog\fP is the property of the University of Sussex. For information
  1257. Xabout academic sales, contact:
  1258. X
  1259. X.sp
  1260. X.in +8
  1261. X.nf
  1262. XMs Alison Mudd
  1263. XSchool of Cognitive and Computing Sciences
  1264. XUniversity of Sussex
  1265. XBrighton
  1266. XSussex
  1267. XBN1 9QH
  1268. XPhone: (0273) 606755
  1269. XE-mail to alim@cogs.sussex.uk.ac
  1270. X.fi
  1271. X.in -8
  1272. X.LP
  1273. XFor Commercial and overseas sales information, contact:
  1274. X.sp
  1275. X.in +8
  1276. X.nf
  1277. XIntegral Solutions Limited
  1278. XUnit 3, Campbell Court
  1279. XBramley
  1280. XBasingstoke
  1281. XHampshire, RG26 5EG
  1282. XPhone: (0256) 88028  Fax: 0256-882182
  1283. XE-mail to isl@integ.uucp
  1284. X.fi
  1285. X.in -8
  1286. X.LP
  1287. XFor information about AlphaPop - a Pop-11 environment for the Macintosh,
  1288. Xcontact:
  1289. X.sp
  1290. X.in +8
  1291. X.nf
  1292. XCognitive Applications Ltd
  1293. X4 Sillwood Terrace
  1294. XBrighton
  1295. XBN1 2LR
  1296. XPhone (0273) 821600
  1297. X
  1298. X.fi
  1299. X.in -8
  1300. X
  1301. X.SH AUTHOR
  1302. XCopyright University of Sussex 1989. All rights reserved.
  1303. X.br
  1304. X   Jonathan Meyer, December 15 1989.
  1305. X
  1306. X.ig
  1307. X--- C.unix/doc/man/poplog.1 --------------------------------------------
  1308. X--- Copyright University of Sussex 1987. All rights reserved. ----------
  1309. END_OF_FILE
  1310. if test 12604 -ne `wc -c <'doc/man/poplog.man'`; then
  1311.     echo shar: \"'doc/man/poplog.man'\" unpacked with wrong size!
  1312. fi
  1313. # end of 'doc/man/poplog.man'
  1314. fi
  1315. if test -f 'doc/sysdoc/PopWidgets.imp' -a "${1}" != "-c" ; then 
  1316.   echo shar: Will not clobber existing file \"'doc/sysdoc/PopWidgets.imp'\"
  1317. else
  1318. echo shar: Extracting \"'doc/sysdoc/PopWidgets.imp'\" \(14708 characters\)
  1319. sed "s/^X//" >'doc/sysdoc/PopWidgets.imp' <<'END_OF_FILE'
  1320. XPoplog Widget Set                                                   Revision 3
  1321. X
  1322. X
  1323. X                         Jonathan Meyer,  14 Jan 1990
  1324. X
  1325. X
  1326. X   SYSDOC *POPWIDGETS.IMP                            Implementation Notes
  1327. X
  1328. X
  1329. X   1. Introduction
  1330. X
  1331. X
  1332. X   This  document  describes some of the implementation  details  of  the
  1333. X   Poplog Widget Set. Specifically, details regarding Poplog Methods  and
  1334. X   Graphic Context Issues are discussed. For further details about  Widg-
  1335. X   ets  and  the X Toolkit, refer to the X  Toolkit  Intrinsics.  Details
  1336. X   about  individual widgets in the Poplog Widget Set are found  in  HELP
  1337. X   *POPWIDGETS.
  1338. X
  1339. X
  1340. X   2. Methods
  1341. X
  1342. X
  1343. X   The Poplog Widget Set implements a new calling technique for accessing
  1344. X   procedures (called methods) that apply to widgets.  Methods are  class
  1345. X   properties,  and  so different classes respond to  different  methods.
  1346. X   Furthermore,  superclass chaining is used, so that each  widget  class
  1347. X   can  respond to a specific method differently.
  1348. X
  1349. X   For  example, the PopGraphic widget class interperts  the XpwMDrawLine
  1350. X   method  by drawing a line on the window of the widget.  The  PopPixmap
  1351. X   widget  class responds to the XpwMDrawLine method by drawing a line on
  1352. X   the widgets Pixmap. Because the PopGraphic widget class is a  subclass
  1353. X   of PopPixmap, drawing a line on a Graphics widget also causes the line
  1354. X   to  be  drawn  on the Pixmap of the widget. This pixmap  is  used  for
  1355. X   refreshing the window of the Graphics widget.
  1356. X
  1357. X
  1358. X   2.1 Calling Methods
  1359. X
  1360. X
  1361. X   Methods are accessed using the procedure XPwCallMethod,   which  takes
  1362. X   a  variable number of arguments depending on which method  is  called.
  1363. X   The prototype for XpwMCallMethod is:
  1364. X
  1365. X        XpwMethodRet XpwCallMethod(w, id, arg1, arg2,  ... argn);
  1366. X        Widget w;
  1367. X        XpwMethodID id;
  1368. X        XpwMethodArg arg1, arg2, ... argn;
  1369. X
  1370. X        w
  1371. X             Specifies the Poplog widget to apply the method to.
  1372. X
  1373. X        id
  1374. X             Specifies the Poplog identification number of the method.
  1375. X
  1376. X        arg1, arg2 ... argn
  1377. X             A list of the arguments to pass to the method.
  1378. X
  1379. X
  1380. X   For example, one of the methods understood by graphics widgets is
  1381. X   XpwMDrawLine, which takes four integer arguments and draws a line
  1382. X   between  them. To draw a line on a graphics widget between  (1,1)
  1383. X   and (100,100), use:
  1384. X
  1385. X        (void) XpwMCallMethod(w, XpwMDrawLine, 1, 1, 100, 100);
  1386. X
  1387. X
  1388. X   2.1.2 Method Lookup
  1389. X
  1390. X
  1391. X   PopCore and its descendants have four additional fields in their class
  1392. X   structures:
  1393. X
  1394. X        XpwMethodList methods;        /* array of method structures */
  1395. X        Cardinal num_methods;         /* XtNumber(methods) */
  1396. X        XpwApplyProc apply_proc;      /* Procedure to apply a method */
  1397. X        XpwAssocTable *methods_table; /* hashed table of methods
  1398. X                                         created at class initialize by the
  1399. X                                         PopCore class_part initialize. */
  1400. X
  1401. X   Method  ID's  are  in fact integer numbers. They are  defined  in  the
  1402. X   header  file  <XpwMethod.h>.   They  are  used  to look  up  XpwMethod
  1403. X   structures in the hash table methods_table. The hashing technique used
  1404. X   is similar to XAssocTables.
  1405. X
  1406. X   The hashing table methods_table is  constructed from the methods  list
  1407. X   using XpwCreateAssoc,   XpwCopyAssoc    and    XpwMakeAssoc  at  class
  1408. X   initialize, by the  PopCore class_part  initialize procedure.  Methods
  1409. X   are found  in the  hash table  using XpwLookupAssoc    procedure.  The
  1410. X   Create, Make and Lookup functions are identical to their XCreateAssoc,
  1411. X   XMakeAssoc and XLookUpAssoc equivelants, except they use XtMalloc, and
  1412. X   work with XpwMethodID's  (not XID's), and so they do not have to worry
  1413. X   about different  displays  with  the same  XID's.    The  XpwCopyAssoc
  1414. X   function copies  all of  the  entries of  one association  table  into
  1415. X   another, using XpwMakeAssoc   for  each entry of  the source table  to
  1416. X   add it to the destination table.
  1417. X
  1418. X   In  most  cases the class_initialize create more than one  bucket  per
  1419. X   method, so the  XpwLookupAssoc  procedure is likely to find the method
  1420. X   after  one  or two checks. This makes method lookup very  rapid  (much
  1421. X   more so than actions or callbacks).
  1422. X
  1423. X
  1424. X   2.1.3 Method Interpretation
  1425. X
  1426. X
  1427. X   XpwCallMethod  works  by looking first  at  the widgets  class  for  a
  1428. X   method  with  the right id. If the method is found, and  there  is  an
  1429. X   apply_proc  for that class, the apply_proc is called with the  method,
  1430. X   the widget, and a pointer to arguments passed  to  XpwCallMethod. This
  1431. X   process is then repeated for the superclasses of the widget class. The
  1432. X   return value of the first apply_proc is returned as the result of  the
  1433. X   XpwCallMethod, since C can only have one return value.
  1434. X
  1435. X   XpwCallMethod will have no effect  when  called with widgets which are
  1436. X   not  descendants of the PopCore widget, or widgets that do not have  a
  1437. X   methods  table,  an  apply proc, or a method  with  the  corresponding
  1438. X   method ID.
  1439. X
  1440. X   If a method has a special Cut flag  set  in  its flags field, then the
  1441. X   superclass chaining is stopped at that method.
  1442. X
  1443. X   2.1.4 Apply Procs
  1444. X
  1445. X
  1446. X   Each XpwMethod structure currently contains:
  1447. X
  1448. X        XpwMethodID id;        /* ID of method (integer) */
  1449. X        XpwMethodProc *proc;   /* pointer to procedure of method */
  1450. X        ShortCard num_args;    /* number of parameters for proc */
  1451. X        Cardinal flags;        /* additional method info */
  1452. X        caddr_t extenstion;    /* for future use */
  1453. X
  1454. X   Apply  procs are of the form:
  1455. X
  1456. X        XpwMethodRet ApplyProc(w, method, args)
  1457. X        Widget w;
  1458. X        XtPopMethod method;
  1459. X        va_alist args;
  1460. X
  1461. X        w
  1462. X             Specifies the Poplog widget to apply the method to.
  1463. X
  1464. X        method
  1465. X             Pointer to the structure for the method being applied.
  1466. X
  1467. X        args
  1468. X             An argument list in the format described by varargs(3).
  1469. X
  1470. X   The  apply  procedure extracts the arguments from args,  examines  the
  1471. X   methods  flags, adds any of its own arguments, and finally  calls  the
  1472. X   method  (usually  using the convenience   routine   XpwMakeCall).  The
  1473. X   value  returned by the method is passed back to the caller. Flags  are
  1474. X   used to determine any additional arguments are be needed to apply  the
  1475. X   method. 
  1476. X
  1477. X   For example,the XpwMDrawLine method requires a drawable and a graphics
  1478. X   context  and takes four arguments. The Method Proc for XpwMDrawLine is
  1479. X   the  Xlib line drawing function, XDrawLine. The Method  structure  for
  1480. X   the XpwMDrawLine method is therefore:
  1481. X
  1482. X        { XpwMDrawLine, XDrawLine, 4, RequiresDrawable | RequiresGC }
  1483. X
  1484. X   2.2 Inheritance
  1485. X
  1486. X   Currently, two of  the additional  fields of the  class structure  for
  1487. X   PopCore widgets can  be inherited  from the superclass.  They are  the
  1488. X   apply_proc  field,   and  the   methods_table  field.   To   inherit a
  1489. X   superclass's  methods,   use  the   entry  XtInheritMethods   in   the
  1490. X   methods_table field. To inherit the superclass's apply procedure,  use
  1491. X   the entry  XtInheritApplyProc  in  the  apply_proc  field.  Additional
  1492. X   methods to those  of the superclass  can be specified  in the  methods
  1493. X   field. At class initialize, the methods from the superclass are  first
  1494. X   added to the hash table for the class, and then those of the class are
  1495. X   added. Finally, the hash table  is stored in the methods_table  field.
  1496. X   This allows a class to inherit most of the methods of the  superclass,
  1497. X   but override superclass methods  or add its own  methods as well.  For
  1498. X   example, the PopGraphic class inherits  all of the PopPixmap  methods,
  1499. X   but adds  a  few  of  its  own. Thus  the  class_part  entry  for  the
  1500. X   PopGraphic widget is as follows:
  1501. X
  1502. X        {/* popcore_part    */
  1503. X        /*   methods        */   popGraphicMethods,
  1504. X        /*   num_methods    */   XtNumber(popGraphicMethods),
  1505. X        /*   apply_proc     */   GraphicApplyProc,
  1506. X        /*   methods_table  */   XtInheritMethods,
  1507. X        }
  1508. X
  1509. X   The class part definition, in PopCoreP.h, defines the new class fields
  1510. X   as:
  1511. X        XpwMethodList methods;        /* array of method structures */
  1512. X        Cardinal num_methods;         /* XtNumber(methods) */
  1513. X        XpwApplyProc apply_proc;      /* Procedure to apply a method */
  1514. X        XpwAssocTable *methods_table; /* hashed table of methods
  1515. X
  1516. X
  1517. X   2.3 Notes
  1518. X
  1519. X   Methods are useful for several reasons:
  1520. X
  1521. X        o    Interpretation of each method is left to the class.
  1522. X
  1523. X        o    Superclass chaining means that each superclass of  a  widget
  1524. X             can act on a method.
  1525. X
  1526. X        o    Methods  can easily be constructed from standard  functions,
  1527. X             making it very easy to add methods to widgets.
  1528. X
  1529. X   This final reason was the main one for implementing methods: Rewriting
  1530. X   every  Xlib drawing and text function for the graphics widget so  that
  1531. X   the  function  would draw on both a pixmap and the window  would  have
  1532. X   been  tiresome and expensive. Additionally, it would have  involved  a
  1533. X   large number of procedures, and hence larger object code size.
  1534. X
  1535. X   The XtAssoc procedures are similarly useful. The X Toolkit has  XtMal-
  1536. X   loc and XtFree procedures like Xmalloc and Xfree. Why it doesn't  have
  1537. X   XtAssoc I don't know.
  1538. X
  1539. X   2.2.1 Naming conventions, and other issues.
  1540. X
  1541. X   The Implementation of methods may change - it was designed in a hurry,
  1542. X   and  could probably be fine tuned. However, the method  calling  tech-
  1543. X   nique is independant of the implementation, so this should not  affect
  1544. X   application programers.
  1545. X
  1546. X   There  is a naming problem regarding methods - each  different  method
  1547. X   should  be  given a different number, and flags for the  methods  must
  1548. X   also be defined. This is currently done in one header file so that the
  1549. X   chances of overlap are reduced. Of course, it would not matter if  two
  1550. X   different  methods  for different classes had the same  ID,  unless  a
  1551. X   programmer  went  off and called a widget of one class with  a  method
  1552. X   from  another.  This would have upredictable  and  undesired  affects.
  1553. X   Currently,  method ID ranges have been assigned to  different  widgets
  1554. X   (this could be applied on a larger scale, so whole trees get a  number
  1555. X   range to use, like network addressing):
  1556. X
  1557. X        PopCore        -    0-200
  1558. X        PopPixmap      -    200-400
  1559. X        PopGraphic     -    400-600
  1560. X        PopScrollText  -    600-800
  1561. X
  1562. X
  1563. X   Similarly,  flags that are used are defined in one file, so that  dif-
  1564. X   ferent  widgets don't use the same bit to represent  different  flags.
  1565. X   Some global flags should be defined:
  1566. X
  1567. X        InheritApplyProc
  1568. X             Use the apply proc for the superclass to apply the method.
  1569. X
  1570. X        ForceReturnVal
  1571. X             Make  return  value for this application of the  method  the
  1572. X             return value of the method call.
  1573. X
  1574. X        MethodError
  1575. X             Call  XtError  to report an error message.  The  proc  field
  1576. X             could  be  used  to point to a string to use  in  the  error
  1577. X             message. Or there could be a lookup table of method names to
  1578. X             id's, or the name could be stored in the method record.
  1579. X
  1580. X        Others?
  1581. X
  1582. X   Other possible improvements include:
  1583. X
  1584. X        o    Full  argument specification, so that parameters other  than
  1585. X             integers can be specified and returned.
  1586. X
  1587. X        o    More complex inheritance of methods. Ability to override  or
  1588. X             augment superclasses methods.
  1589. X
  1590. X   3. Graphics Contexts
  1591. X
  1592. X   The PopPixmap widget uses the initialize_hook, get_values_hook and the
  1593. X   set_values_hook entries of the class structure to initialize, get  and
  1594. X   set fields of the graphics context from resource entries and  argument
  1595. X   lists.  These fields are called subparts, since they are not  directly
  1596. X   part of the widget structure, but are pointed to by one of the  fields
  1597. X   in  the widget.
  1598. X
  1599. X   The  GC  subpart of the widget is in fact the XGCValues entry  of  the
  1600. X   usersGC field of the widget. Since widgets can share Graphics  contex-
  1601. X   ts,  they  can also share GCsubparts. Because of this,  the  hooks  to
  1602. X   initialize  and set subpart values must write changes to  a  different
  1603. X   XGCValues structure, and then compare this structure to the  original.
  1604. X   If  there  are changes, then UpdateGC is called. In more  detail,  the
  1605. X   procedure works as follows:
  1606. X
  1607. X
  1608. X   3.1 InitSubpartValues, GetSubpartValues, SetSubpartValues
  1609. X
  1610. X
  1611. X   The InitSubpartValues procedure uses a global XGCValues structure  and
  1612. X   valuemask.  First  it  copies the values from the current  GC  of  the
  1613. X   widget into the global XGCValues structure (using GCsubpartCopy). Then
  1614. X   It  calles  XtGetSubresources to fill in the slots  of  the  XGCValues
  1615. X   structure from the resource database. Finally, it examines the  fields
  1616. X   of  the  structure that are resources, compares them to  the  original
  1617. X   XGValues  for the widget, and sets the relevant fields of a  valuemask
  1618. X   (using  GCsubpartMask)  so  that a subsequent call  to  UpdateGC  will
  1619. X   affect the slots that are specified in the resource database.
  1620. X
  1621. X   SetSubpartValues  works  in a similar fashion, except  that  it  calls
  1622. X   XtSetSubvalues  to  set the slots in the global  XGCValues  structure.
  1623. X   Then  it calls UpdateGC with the correct valuemask  (determined  using
  1624. X   GCsubpartMask).
  1625. X
  1626. X   GetSubpartValues simply calls XtGetSubvalues with the GCsubpart of the
  1627. X   widget.
  1628. X
  1629. X   The SetValues procedures also use this Global XGCValues structure  and
  1630. X   valuemask.  Because  of this, changes to the  users  graphics  context
  1631. X   which  involve parts of the widget structure (such as  foreground  co-
  1632. X   lour)  and parts of the subpart structure (such as GC  function)  only
  1633. X   involve one UpdateGC call.
  1634. X
  1635. X
  1636. X   3.2 Updating Graphics Contexts
  1637. X
  1638. X
  1639. X        UpdateGC(w, valuemask, values)
  1640. X        Widget w;
  1641. X        XtGCMask valuemask;
  1642. X        XtGCValues *values;
  1643. X
  1644. X        w
  1645. X             Widget to modify
  1646. X
  1647. X        valuemask, values
  1648. X             As for XChangeGC or XCreateGC
  1649. X
  1650. X   UpdateGC  first looks to see if the Graphics Context of the widget  is
  1651. X   shared.  Shared Graphics Contexts are read-only, and so should not  be
  1652. X   modified.  If  the widget is sharing a graphics context,  then  a  new
  1653. X   graphics  context is created, with the current graphics contexts  set-
  1654. X   tings. Finally XChangeGC is called to modify the graphics  context.
  1655. X
  1656. X
  1657. X   3.3 Notes
  1658. X
  1659. X
  1660. X   The  subpart setting system works well, but it would be useful  to  be
  1661. X   able  to use the same scheme to set and modify more than one  graphics
  1662. X   context (determined by class?). Additionally, different subclasses  of
  1663. X   the PopPixmap widget require different subparts of the graphics context
  1664. X   (the  PopScrollText  widget doesn't need the  GCLineWidth  resource!).
  1665. X
  1666. END_OF_FILE
  1667. if test 14708 -ne `wc -c <'doc/sysdoc/PopWidgets.imp'`; then
  1668.     echo shar: \"'doc/sysdoc/PopWidgets.imp'\" unpacked with wrong size!
  1669. fi
  1670. # end of 'doc/sysdoc/PopWidgets.imp'
  1671. fi
  1672. echo shar: End of archive 2 \(of 2\).
  1673. cp /dev/null ark2isdone
  1674. MISSING=""
  1675. for I in 1 2 ; do
  1676.     if test ! -f ark${I}isdone ; then
  1677.     MISSING="${MISSING} ${I}"
  1678.     fi
  1679. done
  1680. if test "${MISSING}" = "" ; then
  1681.     echo You have unpacked both archives.
  1682.     rm -f ark[1-9]isdone
  1683. else
  1684.     echo You still need to unpack the following archives:
  1685.     echo "        " ${MISSING}
  1686. fi
  1687. ##  End of shell archive.
  1688. exit 0
  1689.  
  1690. dan
  1691. -----------------------------------------------------------
  1692.             O'Reilly && Associates
  1693.         argv@sun.com / argv@ora.com
  1694.        632 Petaluma Ave, Sebastopol, CA 95472 
  1695.      800-338-NUTS, in CA: 800-533-NUTS, FAX 707-829-0104
  1696.     Opinions expressed reflect those of the author only.
  1697.